<?php namespace Home\Controller;
use Hdphp\Controller\Controller;
use Common\Model\Category;
class CategoryController extends Controller{
	public function index(){
		$cateModel=new Category;
		$cate=$cateModel->where("pid=0")->get();
		foreach($cate as $k=>$v){
			$cate[$k]['son']=$cateModel->where("pid={$v['cid']}")->get();
		}
//		p($cate);
		View::with('cate',$cate);
		View::make();
	}
}
